package com.wechet.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wechet.common.CodeEnum;
import com.wechet.common.OrderStatus;
import com.wechet.common.ProductStatus;
import com.wechet.utils.EnumUtil;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;

/**
 * Created by sc on 2017/9/20.
 */

@Entity
@Data
@DynamicUpdate
public class ProductInfo {
    @Id
    private String productId;

    private String productName;
    private BigDecimal productPrice;
    private Integer productStock;
    private String productDescription;
    private String productIcon;
    private Integer productStatus;
    private Integer categoryType;

    @JsonIgnore
    public ProductStatus getProductstatusenum() {
        return EnumUtil.getByCode(productStatus, ProductStatus.class);
    }
}
